//
//  HENoticeDayItemCell.m
//  HealthFamily
//
//  Created by 吴欧 on 2020/12/31.
//  Copyright © 2020 honglutec. All rights reserved.
//

#import "HENoticeDayItemCell.h"

@interface HENoticeDayItemCell ()

@property (strong, nonatomic) UILabel *titleLb;
@property (strong, nonatomic) UIView *warp;
@end

@implementation HENoticeDayItemCell

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self initUI];
    }
    return self;
}

- (void)initUI {
    
    UIView *warp = [UIView new];
    warp.backgroundColor = CSplitLineColor;
    warp.layer.cornerRadius = 30;
    warp.layer.masksToBounds = YES;
    [self.contentView addSubview:warp];
    _warp = warp;
    
    [warp mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.right.left.bottom.equalTo(self.contentView);
    }];
    
    // 标题
    _titleLb = [UILabel new];
    _titleLb.text = @"周一";
    _titleLb.textColor = CNavLightBlackColor;
    _titleLb.font = DYFont(14);
    _titleLb.textAlignment = NSTextAlignmentCenter;
    [warp addSubview:_titleLb];
    
    [_titleLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(warp).mas_offset(5);
        make.left.equalTo(warp).mas_offset(5);
        make.right.equalTo(warp).mas_offset(-5);
        make.bottom.equalTo(warp).mas_offset(-5);
    }];
}

- (void)setModel:(HEPickerResModel *)model {
    _titleLb.text = model.value;
    if (model.isSelect) {
        _warp.backgroundColor = KHexColor(@"D5E6FB");
    }else {
        _warp.backgroundColor = CSplitLineColor;
    }
}

@end
